<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        body{
            height:2000px;
        }
        #box{
            height:100px;
            width:100px;
            background-color: red;
            position:fixed;
            left:100px;
            top:100px;
            /* margin:100px; */
        }
    </style>
</head>
<body>
    <div id="box"></div>
    <script>
        box.onclick=function(e){
           //console.log(e.offsetX,e.offsetY);
           //console.log(e.clientX,e.clientY);
           //console.log(e.pageX,e.pageY);
           console.log(e.screenX,e.screenY);
        }
    </script>
</body>
</html>